# 1
# create
a = 'a'
a += 'bcd'
print(a)

# retrieve
print(a.index('d'))
print(a.startswith('abc'))
print(a[0:2])

# update
print(a.replace('a', 'z'))
print(a)

b = '2020/10/25'
print(b.split('/'))
print('/'.join(b.split('/')))

# delete
print(b.rstrip('25'))

# 2
print('{}+{}'.format(1, 2))
print('{1},{0},{1}'.format('t', 'chongqing'))
print(f'{a}+{b},{a}' + 't')
print("{:.2f}".format(123.45678))

# 3
with open(r'第二周_第二节tmp.py','r',encoding='utf-8') as fp:
    data = fp.read()
    with open(r'第二周_第二节.py', 'w', encoding='utf-8') as f:
        f.write(data)
